import request from '@/utils/request'

// 查询【请填写功能名称】列表
export function listPassthrough(query) {
  return request({
    url: '/iot/passthrough/list',
    method: 'get',
    params: query
  })
}

// 查询【请填写功能名称】详细
export function getPassthrough(id) {
  return request({
    url: '/iot/passthrough/' + id,
    method: 'get'
  })
}

// 新增【请填写功能名称】
export function addPassthrough(data) {
  return request({
    url: '/iot/passthrough',
    method: 'post',
    data: data
  })
}

// 修改【请填写功能名称】
export function updatePassthrough(data) {
  return request({
    url: '/iot/passthrough',
    method: 'put',
    data: data
  })
}

// 策略状态修改
export function changePassthroughStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/iot/passthrough/changeStatus',
    method: 'put',
    data: data
  })
}

// 删除【请填写功能名称】
export function delPassthrough(id) {
  return request({
    url: '/iot/passthrough/' + id,
    method: 'delete'
  })
}


// 查询策略详情
export function passthroughDetail(passthroughId) {
  return request({
    url: '/iot/passthrough/passthroughDetail?passthroughId='+passthroughId,
    method: 'get',
    passthroughId
  })
}